#include <my_head.h>
int main(int argc, char const *argv[])
{
    pid_t pid = fork();
    if(-1 == pid){
        ERR_LOG("fork error");
    }else if(0<pid){
        sleep(2);
        printf("这是A进程 pid = [%d]  ppid[%d]\n",getpid(),getppid());
    }else if(0 == pid){
        if(-1 == (pid = fork())){
            ERR_LOG("fork error");
        }else if(0<pid){
            sleep(1);
            printf("这是B进程 pid = [%d]  ppid[%d]\n",getpid(),getppid());
        }else if(0 == pid){
            printf("这是C进程  pid = [%d] ppid[%d]\n",getpid(),getppid());
        }
    }
    return 0;
}
